import request from '@/router/axios';
import {downloadExcel} from '@/router/axios';
import {formatCondition} from '@/util/util';
//单条查询
export const queryGeneralFileInfo = (params) => {
  params.head.transCode = 'queryGeneralFileInfo';
  return request({
    url: '/general/generalFileInfo/queryGeneralFileInfo',
    method: 'post',
    data: params
  })
}
//多条列表查询，支持条件查询
export const queryGeneralFileInfoListPage = (params) => {
  params.head.transCode = 'queryGeneralFileInfoListPage';
  return request({
    url: '/general/generalFileInfo/queryGeneralFileInfoListPage',
    method: 'post',
    data: params
  })
}
//新增单条记录
export const saveGeneralFileInfo = (params) => {
  params.head.transCode = 'saveGeneralFileInfo';
  return request({
    url: '/general/generalFileInfo/saveGeneralFileInfo',
    method: 'post',
    data: params
  })
}
//新增多条记录
export const saveGeneralFileInfoList = (params) => {
  params.head.transCode = 'saveGeneralFileInfoList';
  return request({
    url: '/general/generalFileInfo/saveGeneralFileInfoList',
    method: 'post',
    data: params
  })
}
//新增或修改单条记录
export const saveOrUpdateGeneralFileInfo = (params) => {
  params.head.transCode = 'saveOrUpdateGeneralFileInfo';
  return request({
    url: '/general/generalFileInfo/saveOrUpdateGeneralFileInfo',
    method: 'post',
    data: params
  })
}


//新增或修改单条记录
export const saveOrUpdateGeneralFileInfoList = (params) => {
  params.head.transCode = 'saveOrUpdateGeneralFileInfoList';
  return request({
    url: '/general/generalFileInfo/saveOrUpdateGeneralFileInfoList',
    method: 'post',
    data: params
  })
}

//修改单条记录
export const updateGeneralFileInfo = (params) => {
  params.head.transCode = 'updateGeneralFileInfo';
  return request({
    url: '/general/generalFileInfo/updateGeneralFileInfo',
    method: 'post',
    data: params
  })
}

//删除单条记录
export const deleteGeneralFileInfo = (params) => {
  params.head.transCode = 'deleteGeneralFileInfo';
  return request({
    url: '/general/generalFileInfo/deleteGeneralFileInfo',
    method: 'post',
    data: params
  })
}

//删除多条记录
export const deleteGeneralFileInfoList = (params) => {
  params.head.transCode = 'deleteGeneralFileInfoList';
  return request({
    url: '/general/generalFileInfo/deleteGeneralFileInfoList',
    method: 'post',
    data: params
  })
}
//导出excel
export const exportGeneralFileInfoExcel = (params) => {
  downloadExcel({
    url: '/general/generalFileInfo/excelDownload/exportGeneralFileInfoExcel',
    method: 'get',
    data: 
    {
      tenantId: params.head.tenantId,
      orders:'',
      condition: formatCondition(params.body.sqlCondition)
    }
  })
}
